<template>
  <view class="pa-4 lh-2">
    <view class="ta-c pa-5" v-if="!html">
      <u-loading-icon />
    </view>
    <u-parse :content="html"></u-parse>
  </view>
</template>

<script>
export default {
  data() {
    return {
      html: "",
    };
  },
  onLoad({ id, title }) {
    this.id = id;
    this.getData();
    this.title = decodeURIComponent(title);
    this.$setTitle(this.title);
  },
  methods: {
    async getData() {
      try {
        const {
          data: { row },
        } = await this.$http.get("/data/item/game-doc", {
          params: {
            id: this.id,
          },
        });
        this.html = row.detail;
      } catch (error) {
        console.log(error);
      }
    },
  },
};
</script>